<template>
  <el-switch
    v-model="modelValue"
    active-color="#13ce66"
    inactive-color="#ff4949">
  </el-switch>
</template>
<script>
export default {
  name: 'EnabledSwitch',
  props: {
    value: {
      type: Number,
      default: ()=> 0
    }
  },
  computed: {
    modelValue: {
      get(){
        return this.value === 1
      },
      set(val){
        this.$emit('update:value', val? 1 : 0)
      }
    }
  }
}
</script>
<style lang="scss" scoped>

</style>